package com.todo.biz.application.frontend.controller;

import com.todo.common.common.entity.response.BizResponse;
import com.todo.biz.application.frontend.service.CollectSetAggService;
import com.todo.biz.iface.frontend.CollectSetFrontendIface;
import com.todo.biz.iface.frontend.request.*;
import com.todo.biz.iface.frontend.response.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author azhebuxing
 * @date 2024/5/28 14:37
 * @description
 */
@Slf4j
@RestController
@RequestMapping("/bizBase/collectSet")
@Tag(name = "收藏集合前台接口", description = "收藏集合前台接口")
public class CollectSetFrontendIController implements CollectSetFrontendIface {

    @Resource
    private CollectSetAggService collectSetAggService;


    @Override
    @Operation(summary = "根据城市查询收藏集合列表")
    @PostMapping("/queryCollectSetByCity")
    public BizResponse<List<CollectSetVO>> queryCollectSetByCity(@RequestBody QueryCollectSetByCityParam param) {
        if (param == null) {
            return BizResponse.success("查询异常，请刷新后重新操作");
        }
        if (!param.baseCheck()) {
            return BizResponse.success("查询失败，请刷新后重新操作");
        }
        return collectSetAggService.queryCollectSetByCity(param);
    }

    @Override
    public BizResponse<CollectSetVO> queryCollectSetById(@RequestBody QueryCollectSetByIdParam param) {
        if (param == null) {
            return BizResponse.success("查询异常，请刷新后重新操作");
        }
        if (!param.baseCheck()) {
            return BizResponse.success("查询失败，请刷新后重新操作");
        }
        return collectSetAggService.queryCollectSetById(param);
    }

    @Override
    @Operation(summary = "美食集合信息列表")
    @PostMapping("/queryCollectFoodSet")
    public BizResponse<List<CollectRestaurantSetVO>> queryCollectRestaurantSet(@RequestBody CollectSetRelationBaseParam param) {
        if (param == null) {
            return BizResponse.success("查询异常，请刷新后重新操作");
        }
        if (!param.baseCheck()) {
            return BizResponse.success("查询失败，请刷新后重新操作");
        }
        return collectSetAggService.queryCollectRestaurantSet(param);
    }

    @Override
    @Operation(summary = "景点集合信息列表")
    @PostMapping("/queryCollectSightSet")
    public BizResponse<List<CollectSightSetVO>> queryCollectSightSet(@RequestBody CollectSetRelationBaseParam param) {
        if (param == null) {
            return BizResponse.success("查询异常，请刷新后重新操作");
        }
        if (!param.baseCheck()) {
            return BizResponse.success("查询失败，请刷新后重新操作");
        }
        return collectSetAggService.queryCollectSightSet(param);
    }

    @Override
    @Operation(summary = "用户攻略集合信息列表")
    @PostMapping("/queryCollectUserStrategySet")
    public BizResponse<List<CollectUserStrategySetVO>> queryCollectUserStrategySet(@RequestBody CollectSetRelationBaseParam param) {
        if (param == null) {
            return BizResponse.success("查询异常，请刷新后重新操作");
        }
        if (!param.baseCheck()) {
            return BizResponse.success("查询失败，请刷新后重新操作");
        }
        return collectSetAggService.queryCollectUserStrategySet(param);
    }

    @Override
    @Operation(summary = "平台攻略集合信息列表")
    @PostMapping("/queryCollectPlatformStrategySet")
    public BizResponse<List<CollectPlatformStrategySetVO>> queryCollectPlatformStrategySet(@RequestBody CollectSetRelationBaseParam param) {
        if (param == null) {
            return BizResponse.success("查询异常，请刷新后重新操作");
        }
        if (!param.baseCheck()) {
            return BizResponse.success("查询失败，请刷新后重新操作");
        }
        return collectSetAggService.queryCollectPlatformStrategySet(param);
    }
}
